﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Test
{
    public interface IAddin
    {
        string s { get; }
    }

    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            vAddins.vAddinsEngine.MandatoryHostReferences.Add(Application.ExecutablePath);
            vAddins.vAddinsEngine.AddinsPath = Application.StartupPath + "\\Addins";

            vAddins.vAddinsEngine.HostApplicationName = "Test";

            try
            {
                vAddins.vAddinsEngine.Initialize();
            }
            catch (Exception s)
            {
                System.Diagnostics.Debug.WriteLine(s);
                 
                foreach (var x in vAddins.Compiler.LastErrors)
                {
                    System.Diagnostics.Debug.WriteLine(x);
                }
            }

            var ex = vAddins.vAddinsEngine.Query<IAddin>();
            foreach (var e in ex)
            {
                listBox1.Items.Add(e.s);
            }
        }
    }
}
